Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cli download to download public node snapshots #13598

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

lean-apple
Copy link
Contributor

@lean-apple lean-apple commented Dec 30, 2024

Closes #13469.

Example of use :

cargo run --bin reth -- download --url https://downloads.merkle.io/reth-2024-10-23.tar.lz4

Starting snapshot download for chain: Chain::Named(Mainnet)
Target directory: "/Users/xxxx/Library/Application/reth/mainnet"
Source URL: https://downloads.merkle.io/reth-2024-10-23.tar.lz4
Downloading... 0.1%

Copy link

codspeed-hq bot commented Dec 30, 2024

CodSpeed Performance Report

Merging #13598 will not alter performance

Comparing lean-apple:cli-download-public-node-snapshots (d7ad3ee) with main (f4ce10b)

Summary

✅ 77 untouched benchmarks

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also maybe add a list of pre-set snapshot URLs so that the user doesn't need to find the URL themselves? And we can default to one of them, while the --help menu shows alternatives/fallbacks?

@lean-apple lean-apple marked this pull request as ready for review January 6, 2025 16:37
@lean-apple
Copy link
Contributor Author

Let's also maybe add a list of pre-set snapshot URLs so that the user doesn't need to find the URL themselves? And we can default to one of them, while the --help menu shows alternatives/fallbacks?

What would you advise me to be able to fetch the same block height they are using in their url ? @matias-gonz @joshieDo
For example, in this url https://snapshots.publicnode.com/ethereum-holesky-reth-3087369.tar.lz4, we see it's3087369,
but if I use let latest_block = provider.get_block_number().await?; I got 3090694.

My aim is to build a default "dynamic" url with the corresponding block height with this pattern :
https://snapshots.publicnode.com/ethereum-{potential network}-reth-{block height}.tar.lz4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new cli command to download public node snapshots
2 participants